package com.yangguang.huahui.mvp.presenter;

import com.yangguang.huahui.entity.FeedList;
import com.yangguang.huahui.mvp.model.NewsModel;
import com.yangguang.huahui.mvp.view.FeedListView;
import com.yangguang.huahui.rx.RxManager;
import com.yangguang.huahui.rx.RxSubscriber;

/**
 * Created by Administrator on 2017/4/17.
 */

public class FeedListPresenter extends BasePresenter<FeedListView>{
    NewsModel model;

    public FeedListPresenter() {
        model = new NewsModel();
    }

    public void getFeedList(String uid, int type){
        mSubscription= RxManager.getInstance().doSubscribe(model.getFeedList(uid, type), new RxSubscriber<FeedList>(false) {
            @Override
            protected void _onNext(FeedList feedList) {
                mView.onSuccess(feedList);
            }

            @Override
            protected void _onError() {
                mView.onError();
            }
        });
    }
}
